package ddemo.dao;

import ddemo.pojo.Charger;
import ddemo.pojo.Interface;
import ddemo.pojo.Parkinglot;

import java.util.List;

public interface ParkinglotMapper {
    @Select("SELECT * FROM `parkinglot`")
    public List<Parkinglot> searchParkinglots();

    @Select("UPDATE parkingspot SET `usestatus` = #{usestatus},`userid` = #{userid} WHERE id = #{id}")
    public int UpdateStatus(@Param("usestatus") String staus, @Param("id") Integer id,@Param("userid") Integer userid);

    @Select("SELECT * from `parkinglot`")
    public List<Parkinglot> getinterface();

    @Select("INSERT INTO `parkinglot` (parkNumber,position) VALUES (#{parkNumber}, #{position})")
    public int addCharger(@Param("parkNumber") Integer parkNumber, @Param("position") String position );

    @Select("UPDATE  `parkinglot` SET `parkNumber` = #{parkNumber},`position` = #{position} WHERE id = #{id}")
    public int updateParkinglot(@Param("parkNumber") Integer parkNumber,@Param("position")String position,@Param("id")Integer id);
}
